package com.leetcode.weekly.contest.no283th;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 覃国强
 * @date 2022-03-06 10:31
 */
public class A01_Excel表中某个范围内的单元格 {



  static
  class Solution {
    public List<String> cellsInRange(String s) {

      char c1 = s.charAt(0);
      char r1 = s.charAt(1);

      char c2 = s.charAt(3);
      char r2 = s.charAt(4);

      List<String> answer = new ArrayList<>();

      for (char c = c1; c <= c2; ++c) {
        for (char r = r1; r <= r2; ++r) {
          answer.add(c + "" + r);
        }
      }

      return answer;
    }
  }

}
